### Measuring Political Attitudes with Word Association - Convergence Validity ###
## Ze Han, Ph.D. Student, Princeton University Department of Politics, zeh@princeton.edu ##
## Naijia Liu, Assistant Professor, Harvard University Department of Government, naijialiu@fas.harvard.edu ##
## Rory Truex, Associate Professor, Princeton University Department of Politics and School of Public and International Affairs, rtruex@princeton.edu ##

setwd("~/Desktop/WAT_PoQ/code")

## Load Packages ##
rm(list=ls(all=TRUE))

library(tidyverse)

## Load datasets and extract proper columns and rows ##
convergence <- read.csv("./data/data.wat.filt.csv", stringsAsFactors = FALSE) %>% 
  filter(core == 1 & nonresponse == 0) %>% 
  select(ResponseID, term.eng, tokens) %>% 
  filter(tokens != "")
  
write.csv(convergence, "./data/convergence.csv", row.names = F)